import {request} from "@/utils/request";
import {getToken} from "@/utils/storage";

export function list() {
    return request({
        url:`/api/course/listAll`,
        method: "get",
        headers: {"token": getToken()}
    })
}

export function updateUserCourse(uid, cid) {
    return request({
        url:`/api/userCourse/update/${uid}/${cid}`,
        method: "PUT",
        headers: {"token": getToken()}
    })
}

export function save(data) {
    return request({
        url:`/api/course/save`,
        method: "post",
        headers: {"token": getToken()},
        data: {
            "pid": data.pid,
            "name": data.name,
            "tid": data.tIdd
        }
    })
}


export function remove(id) {
    return request({
        url:`/api/course/remove/${id}`,
        method: "delete",
        headers: {"token": getToken()},
    })
}
